import { useUsersStore } from '@/stores/user'
import { storeToRefs } from 'pinia'
import { Query } from '../../../zondy_api/Query'
const store = useUsersStore()
const {rnsc,fbggdata} = storeToRefs(store)
export const clipsuc=function(result,map){
   var resultNamecli=store.rnsc
    // console.log(result)
    var resultLayer
    if (result.succeed) {
     resultLayer = new Zondy.Map.GdbpLayer('', [resultNamecli], {
        ip: 'localhost',
        port: 6163,
      })
      // console.log(resultLayer)
      map.addLayer(resultLayer)
      var service = {
        name: 'guanggu',
        layerId: 0,
      }
      var url=resultNamecli
      console.log(url);
      //查询要素
      Query.queryByUrl({
        service,
        url,
        success:(res)=>{
          // console.log(res);
          store.fbggdata=store.fbggdata.concat(res.SFEleArray)
        },
      })
    }
    return resultLayer
}